﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Globalization;
using System.Web.Mvc;
using agent02.com.somee.g02travel;
using agent02.Model;

namespace agent02.Model
{
    // this one is for WSTravel1
    public class TravelSearchModel
    {
        public string tourType { get; set; }
        public string departure { get; set; }
        public string destination { get; set; }
    }

    public class TravelSearchResultModel
    {
        AgentDBEntities db = new AgentDBEntities();
        public ListTour[] listTour { get; set; }
        public double heSo { get; set; }
        public TravelSearchResultModel()
        {
            heSo = (from h in db.NHA_CUNG_CAP
                    where h.TenNCC == "G02 Travel"
                    select h.HeSo).Single().Value;
        }
    }

    // this one is for WSTravel2
    public class TravelAdvanceSearchModel
    {
        public string tourType { get; set; }
        public DateTime dateFrom { get; set; }
        public DateTime dateTo { get; set; }
        public float priceFrom { get; set; }
        public float priceTo { get; set; }
        public string location { get; set; }

        public TravelAdvanceSearchModel()
        {
            string datefrom = "01/01/1800";
            string dateto = "01/01/3000";
            string pattern = "dd/MM/yyyy";
            DateTime df = new DateTime();
            DateTime dt = new DateTime();
            DateTime.TryParseExact(datefrom, pattern, null, DateTimeStyles.None, out df);
            DateTime.TryParseExact(dateto, pattern, null, DateTimeStyles.None, out dt);
            dateFrom = df;
            dateTo = dt;
            priceFrom = 0;
            priceTo = 900000;
        }
    }

    public class TravelTourDetailModel
    {
        AgentDBEntities db = new AgentDBEntities();
        public ListTourDetail tour { get; set; }
        public double heSo { get; set; }
        public bool air { get; set; }
        public TravelTourDetailModel()
        {
            heSo = (from h in db.NHA_CUNG_CAP
                    where h.TenNCC == "G02 Travel"
                    select h.HeSo).Single().Value;
        }
    }

    public class TravelBuyModel
    {
        public int adultsNum { get; set; }
        public int childenNum { get; set; }

        public TravelBuyModel()
        {
            adultsNum = 0;
            childenNum = 0;
        }
    }
}